From: csteipp Date: Thu, 28 Aug 2014 18:04:57 +0000 (-0700) Subject: Load password information when expiring X-Git-Tag: 1.31.0-rc.0~14238^2 X-Git-Url: http://git.cyclocoop.org/%22.%24match%5B1%5D.%22?a=commitdiff_plain;h=3ab9d9964beaffdca22cc02a1771eab4dcce1d24;p=lhc%2Fweb%2Fwiklou.git Load password information when expiring Call loadPasswords when expiring the user's password, otherwise the change is overwritten with the previous value. This lets you do: $u = User::newFromName( 'User' ); $u->expirePassword(); And the user will have to reset their password on the next login. Change-Id: I47325dde1ce14280088efdc90ce7887b45e0dc6a --- diff --git a/includes/User.php b/includes/User.php index 665edb973c..6b42994ef7 100644 --- a/includes/User.php +++ b/includes/User.php @@ -829,7 +829,7 @@ class User implements IDBAccessObject { * @param int $ts Optional timestamp to convert, default 0 for the current time */ public function expirePassword( $ts = 0 ) { - $this->load(); + $this->loadPasswords(); $timestamp = wfTimestamp( TS_MW, $ts ); $this->mPasswordExpires = $timestamp; $this->saveSettings();